#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@file:user_expiration.py
@time:2017/7/3 0003 11:02
"""
import datetime

def userValidity(Validitydata):
    Validitydata = int(Validitydata)
    if Validitydata != 99999:
        dt = datetime.datetime.now()
        Validity = datetime.timedelta(days=Validitydata)
        dtobj = dt + Validity
        dtstr = dtobj.strftime('%Y-%m-%d %H:%M:%S')
    else:
        dtstr = '永久有效'
    return dtstr

